1. Field of the Invention
The present invention relates to an optical disk, and more specifically, to a method of defect management for an optical disk.
2. Description of the Prior Art
Optical disks, given their compact size, high capacity storage, and low price have rapidly become one of the most dominant, permanent storage media in our contemporary information society. The development of CD-W has made it possible for users to write data onto an optical disk in accordance with their own specific needs, which affords CD-W a higher degree of flexibility in application. For their part, the information technology industry has been devoted to the research and development of various technologies to make CD-W even more reliable and durable.
Please refer to FIG. 1, which shows a schematic diagram of a typical optical drive 10. The optical drive 10 comes equipped with a spindle 14 to carry an optical disk 22, a motor 12 that drives the spindle 14, a read/write head 16 that accesses data on the optical disk 22, a control circuit 18 that controls the operation of the optical drive 10, and a memory 20 (such as dynamic random access memory, DRAM) that serves as a temporary storage device to record all relevant data during the operation of the control circuit 18.
The data on the optical disk 22 is recorded sequentially on a track 24 through pit and land markings. When the optical disk drive 10 is ready to write data onto the disk 22, the drive 10 first stores the intended data in the memory 20 before writing it onto the disk 22. The read/write head 16 meanwhile checks for defects on the disk 22 and passes on a check result to the control circuit 18.
Often due to defects stemming from scratch marks, variation in material properties, or interference from dust, we cannot write data onto an optical disk. To improve the reliability of re-writable optical disks, the information technology industry has committed itself to research and development efforts in optical disk defect management. For instance, one recent development is the introduction of compact disk Mount Rainier re-writable (CD-MRW) format, which sets aside spare areas (SAs) on an optical disk. When certain parts of the disk become defective, which renders data storage unworkable, CD-MRW redirects the target data for storage to an SA. Please refer to FIG. 2 and FIG. 1. FIG. 2 is an illustration of a format for the typical optical disk 22. In this format, the data track 24 of the optical disk 22 is divided into several main areas. These include a lead-in area LI, a program area PA, and a lead-out area LO. The lead-in area LI and lead-out area LO are used respectively to designate the beginning and ending of the track 24. The program area PA is primarily used to record the data that is to be written onto the optical disk 22. In the lead-in area LI a main table area MTA is established for the storage of a defect table DT. The program area PA is further divided into pre-gap P0, a general application area GAA, and a secondary table area STA, along with a plurality of data areas DA(1) to DA(N) and their corresponding spare areas SA(1) to SA(N). In the secondary table area STA a back-up of the defect table DT is stored. Each data area DA(1)–DA(N) is further divided into a pre-determined number of packets Pd, which comprise a pre-determined number of user data blocks Bd. Each spare area SA is also divided into a pre-determined number of packets Ps, which comprise a pre-determined number of spare data block Bs. The user data blocks Bd and spare data blocks Bs are all of the same data storage capacity and are data writable. For instance, under the CD-MRW format, each data area DA has 136 packets Pd, and each packet Pd comprises 32 data blocks Bd. In each spare area SA there are 8 packets Ps, and each packet Ps has in place 32 spare data blocks Bs. All these data locations have fixed addresses to identify their locations on the track 24.
To write user data onto an optical disk as specified in FIG. 2, the optical drive 10 treats each data block Bd as a basic unit, writing data on to each data block Bd within a packet Pd in an orderly fashion. For instance, when every data block Bd in the data area DA(1) contains user data, any subsequent data would be directed to an available data block Bd in the data area DA(2). By contrast, spare areas SA are not needed for data storage during the normal write-in process. However, should a data block Bd become defective during write-in, an available spare data block Bs within a spare area SA would become the location for data storage. If the spare data block Bs also turns out to be defective during the write-in, then another available spare data block Bs would have to be located for the original data storage. By applying this format and method of operation, an accurate data write-in is guaranteed, and the data storage capability of an optical disk is not compromised due to a partial defect of an optical disk. The address of the defective blocks Bd and Bs are recorded in the defect table DT. And when the optical disk drive 10 tries to read the data in the defective blocks Bd or Bs, the control circuit 18 follows the instructions from the defect table DT to where the spare data block Bs is located and access the corresponding data.
During write-in, the optical drive 10 is capable of detecting whether or not a single data block Bd or Bs in a packet Pd is defective. However when the optical drive 10 writes to disk 22, it uses the packet Pd as a basic unit. In other words, it must write the entire data block Bd into a packet Pd on the track 24. As previously discussed, data intended for defective data blocks Bd or Bs would be redirected to another spare block Bs. Hence, the optical drive 10 follows a certain process in writing the entire packet Pd that contains the target data block Bd onto the optical disk 22. Please refer to FIG. 3 (in conjunction with FIG. 1). A flowchart illustrates a process 100 with which the target block Bd or Bs is written onto the disk 22 as part of a packet Pd unit. The process 100 of the flowchart comprises the following steps:
Step 102:
Begin. When the control circuit 18 of the optical drive 10 is about to write data to a block Bd or Bs, which happens to be defective, the process 100 is executed to redirect the target data to another block Bs in the disk 22;
Step 104:
Amongst all available packets Ps in every spare area SA, search for a spare block Bs that is data-writable;
Step 106:
Once a suitable spare block Bs is located, a memory space is allocated in the memory 20 of the optical disk drive 10, which then temporarily records all data in the data blocks of the packet Ps that contains the spare block Bs;
Step 108:
After reading data of the packet Ps that contains the spare block Bs from the memory 20, the optical disk drive 10 adds the target data to this packet Ps, which is then written onto the optical disk 22. As mentioned earlier, since the optical disk drive 10 uses the packet Ps as a basic data unit, it is necessary for the optical disk drive 10 to read all the data included in the packet Ps that contains the spare block Bs, then add in new data, and finally write the packet Ps onto the optical disk 22;
Step 110:
While writing data onto the disk 22, should the optical disk drive 10 detect new defects, step 102 is executed; otherwise continue with step 112;
Step 112:
After the successful write-in of the entire packet Pd onto the disk 22, the data in memory 20 is no longer needed. Of course, the addresses for the defective block Bd and spare block Bs are recorded respectively in the defect table DT. The defect table DT can be temporarily stored in the memory 20 during the optical disk drive 10 write-in;
Step 114:
If additional defect processing is needed, then return to step 102; otherwise continue to step 116; Step 116: End.
To further explain the aforementioned process, please refer to FIG. 4A and FIG. 4B (in conjunction with FIG. 3). FIG. 4A and FIG. 4B illustrate respectively what occurs in the track 24 of the optical disk 22 and in the memory 20 of the optical disk drive 10 during data storage. As illustrated in FIG. 4A, suppose data Bd0 is to be written to a user data block Bd1 of a packet Pd1 in the track 24. The block Bd1 is found to be defective, and thus the process 100 is executed. Suppose step 104 locates a write-in-ready spare data block Bs2 in the packet Ps1, and step 106 reads all data blocks in packet Ps1 into the memory 20. Then, in step 108, the data Bd0 is added to the packet Ps1, which is temporarily stored in the memory 20. As a result, the previously empty spare data block Bs2 now includes the data Bd0. In FIG. 4B, step 108 continues to write the packet Ps1, which includes new data, onto the track 24 of the optical disk 22. If no further defects are found during the write-in, FIG. 4B illustrates what follows a successful write-in. The data Bd0, which was intended for defective block Bd1, is written into the spare block Bs2. The packet Ps1 temporarily stored in the memory 20, as illustrated in FIG. 4A, is released during step 112, which frees up the memory space. As for the packet Ps1 on the track 24, although all spare data blocks have been rewritten (due to the requirement that optical disk drives must conduct writing in units of packets), the only new addition is the data Bd0 with the data read in step 106.
The process 100 illustrated in the flowchart of FIG. 3 is capable of reading the packet Pd that contains the spare data block from the memory 20 of optical disk drive 10, which adequately reconciles the difference between the write-in mechanism of the optical disk drive 10 with the defective/compensation mechanism (the former is based on packets and the latter is based on blocks). So every individual spare data block could replace a defective data block without squandering the entire packet in a spare area. As illustrated in FIG. 4A and FIG. 4B, blocks Bs0 and Bs1 of packet Ps1 may store data intended for other packets (other than packet Pd1), and may not record packet data that includes Bd0.
However, process 100 of the flowchart of FIG. 3 does have weakness. When there are numerous defects on the disk 22, the process can cause a major drain on the memory 20 precipitating a memory shortage, sometimes to the point of incapacitating a computer system. Please refer to FIG. 5, which illustrates defect management and memory 20 operation in the case of multiple defects on an optical disk. Similar to the initiation phase in FIG. 4A, suppose data Bd0 is to be written to the data block Bd1 of the packet Pd1, and block Bd1 happens to be defective. After locating a spare data block Bs2 in the packet Ps1, step 106 of the process 100 reads data in the packet Ps1 into the memory 20. Wherein step 108 adds data Bd0 to the data of the packet Ps1, and writes the updated data stored in the memory 20 back to the packet Ps1 on track 24. In contrast to FIG. 4A and FIG. 4B, suppose that during write-in the block Bs1 of the packet Ps1 is found to be defective. At this point, the process 100 returns to step 102 to manage defective data block Bs1. Suppose that during step 104 a spare data block Bs5 is located in the packet Ps2 to replace the defective block Bs1. Then in step 106 a new packet is allocated to memory 20 to accommodate all data in the packet Ps2, followed by step 108 where data in block Bs1 is added to the packet Ps2, which is then written back onto track 24. Now suppose during write-back a data block Bs4 in the packet Ps2 turns out to also be defective, the process 100 returns to step 102, trying to locate a spare data block for defective block Bs4. Assume that a data block Bs8 in a packet Ps3 is to replace the defective block Bs4, which means that during step 106 another memory space is allocated to read data in the packet Ps3 to the memory 20. Then in step 108, data in the block Bs4 is added to the packet Ps3, which is temporarily stored in the memory 20, and an updated packet Ps3 is again written onto track 24 of the optical disk 22. Notice that even if the write-back is successful, the process 100, after releasing Ps3 from the memory 20 (step 112), still needs to keep packets Ps2 and Ps1 in the memory 20. The reason being that, replacement data blocks have yet to be located for the previously discovered defective data blocks Bd1 and Bs1. Hence, the process 100, after finished with the defective data block Bs4, still needs to return to step 102 from step 114 to re-process defective data block Bs1. After locating the replacement data block for defective block Bs1, a space is allocated in memory 20 to read in all data in the packet containing the replacement data block for trying to write back onto the track 24 after updating.
Based on the aforementioned discussion we can conclude that when there are multiple defects on an optical disk, the process 100 shown in the flowchart of FIG. 3 requires a large amount of memory space to work with. Every time the process 100 tackles a defective data block, a packet containing a plurality of data blocks is allocated in the memory 20 to read in all the data in the packet. If more defects occur on an optical disk, the process 100 easily uses up a huge amount of space in the memory 20, which causes execution of any forthcoming operations of the optical disk drive 10 to be very difficult.
With the prior art technology, it takes an entire packet of memory space to manage a defective data block. Once defects become abundant on an optical disk, this causes a tremendous drain on memory space and resources, adversely affecting the efficiency of the optical disk drive.